from vcr.model import *
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine

##
## Configure some fake data, just to work with

def main():
    ibm = Customer("IBM")
    microsoft = Customer("Microsoft")
    overheid = Customer("Overheid")
    
    p1 = Project("New IBM site")
    p1.customer = ibm
    
    p2 = Project("IBM RCTK Work")
    p2.customer = ibm
    
    p3 = Project("Debugging")
    p3.customer = microsoft
    
    p4 = Project("Geld verslinden")
    p4.customer = overheid
    
    p5 = Project("Noord-Zuidlijn")
    p5.customer = overheid
    
    p6 = Project("Rekeningrijden")
    p6.customer = overheid
    
    a1 = Activity("Research")
    a2 = Activity("Development")
    a3 = Activity("Documentation")
    a4 = Activity("Testing")
    
    engine = create_engine("sqlite:///vcr.db", echo=True)
    metadata.create_all(engine)
    Session = sessionmaker(bind=engine)
    session = Session()
    session.add(ibm)
    session.add(microsoft)
    session.add(overheid)
    session.add(p1)
    
    session.add(p2)
    session.add(p3)
    session.add(p4)
    session.add(p5)
    session.add(p6)
    session.add(a1)
    session.add(a2)
    session.add(a3)
    session.add(a4)
    
    session.commit()
    
    # print session.query(Project).all()
